From 1370e6c9e0da94f74c13ca07f2688cbcf3a0d2a0 Mon Sep 17 00:00:00 2001 From: "kfraser@localhost.localdomain" Date: Wed, 18 Oct 2006 18:37:18 +0100 Subject: [PATCH] [TPM] Check the existence of the xenstore path before trying to read from it. This prevents an error from being logged. Use the wrapped command for reading from the xenstore instead of the native one. Signed-off-by: Stefan Berger --- tools/examples/vtpm-common.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/examples/vtpm-common.sh b/tools/examples/vtpm-common.sh index e5e8ddbbf5..bf50f323e3 100644 --- a/tools/examples/vtpm-common.sh +++ b/tools/examples/vtpm-common.sh @@ -226,7 +226,7 @@ function vtpmdb_remove_entry () { # Returns 'resume' or 'create' function vtpm_get_create_reason () { local resume - resume=$(xenstore-read $XENBUS_PATH/resume) + resume=$(xenstore_read $XENBUS_PATH/resume) if [ "$resume" == "True" ]; then echo "resume" else @@ -287,6 +287,8 @@ function vtpm_create_instance () { #entry is kept in the VTPMDB file. function vtpm_remove_instance () { local instance reason domname + #Stop script execution quietly if path does not exist (anymore) + xenstore-exists "$XENBUS_PATH"/domain domname=$(xenstore_read "$XENBUS_PATH"/domain) if [ "$domname" != "" ]; then @@ -383,7 +385,7 @@ function vtpm_domid_from_name () { local id name ids ids=$(xenstore-list /local/domain) for id in $ids; do - name=$(xenstore-read /local/domain/$id/name) + name=$(xenstore_read /local/domain/$id/name) if [ "$name" == "$1" ]; then echo "$id" return -- 2.30.2